package com.ruoyi.template.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.template.domain.TemplateDetail;
import com.ruoyi.template.service.TemplateDetailService;
import com.ruoyi.template.mapper.TemplateDetailMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TemplateDetailServiceImpl extends ServiceImpl<TemplateDetailMapper, TemplateDetail>
    implements TemplateDetailService{

    @Autowired
    private TemplateDetailMapper  templateDetailMapper;
    /**
     * 获取模板详情
     */
    @Override
    public List<TemplateDetail> getTemplateDetailList(String templateId) {

        LambdaQueryWrapper<TemplateDetail> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(TemplateDetail::getTemplateId,templateId);
        queryWrapper.orderByAsc(TemplateDetail::getReviewOrder);

        return templateDetailMapper.selectList(queryWrapper);
    }
}




